#ifndef _FOOD_DEFINE_H
#define _FOOD_DEFINE_H


#include <cstdio>

int get_my_rand(int n);


class FoodNode
{
public:
    FoodNode()
    {
        m_x = 0;
        m_y = 0;
        
    }

    FoodNode(int x, int y)
    {
        m_x = x;
        m_y = y;
    }

    bool operator ==(const FoodNode &other)
    {
        return (m_x == other.m_x)&&(m_y == other.m_y);
    }

    void set_rand_pos(void)
    {
        m_x = get_my_rand(80);
        m_y = get_my_rand(80);
    }

    void set_pos(int x, int y)
    {
        m_x = x;
        m_y = y;
    }

    int get_x()
    {
        return m_x;
    }

    int get_y()
    {
        return m_y;
    }

    bool check_valid();
    void create_a_valid_food();
//private:
    int m_x;
    int m_y;

};


#endif